﻿using System;
using System.Collections.Generic;

namespace Pixels.Interface
{
    class SideButton : Button
    {
        string symbol;


        public SideButton(int x, int y, int w, int h, string symbol) : base("", x, y, w, h) {
            this.symbol = symbol;
        }

        public override void render() {

            if (!Visible) return;
            var offX = (1f - scale) * 100f;
            var spr = Render.spriteInBox("side_button", ScreenRect.move(offX, 0) , true);
            spr.color = color;            

            if (clickSigma > 0f) clickSigma += Sargon.Game.frame_time * 4;
            if (clickSigma > 1f) clickSigma = -1f;

            spr.zed = zed * 10f;

            var kmb = Render.sprite(symbol, this.ScreenRect.center() + new Ur.crds2(10 + offX, 0), 1f, true);
            kmb.zed = spr.zed + 1f;
        }

        public override void input(Sargon.InputState state) {
            base.input(state);
        }

        public void hide() {
            visible = false;
        }

        public void show() {
            visible = true;
        }

    }
}
